﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EditIntake.aspx.cs" Inherits="AntiObesity.Services.EditIntake" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server"><title>Edit intake</title>
<link href="css/reset.css" rel="stylesheet" type="text/css" />
<script src="Contents/jquery.js" type="text/javascript"></script>
<script src="Contents/jquery-ui.js" type="text/javascript"></script>
<script src="Contents/jquery-autocomplete.js" type="text/javascript"></script>
<script src="Contents/jquery-validate.js" type="text/javascript"></script>
<script src="Contents/jquery.en-GB.js" type="text/javascript"></script>
<link href="Contents/css/ui-lightness/jquery-ui.css" rel="stylesheet" type="text/css" />
<link href="css/default.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <span class="form">
        <span class="items-body">
            <span class="item">
                <span class="label">
                    <label for="txtFoodName">Amount:</label>
                </span>
                <span class="input">
                    <asp:TextBox ID="txtAmount" runat="server" Width="100"></asp:TextBox><span class="info">(grams)</span>
                </span>
            </span>
        </span>
        <span class="buttons">
            <asp:Button ID="btnSave" runat="server" Text="Save" onclick="btnSave_Click" />
            <a href="javascript:parent.$.fancybox.close();">Cancel</a> 
        </span>
    </span>
    </form>
    <script type="text/javascript">
        var validator = $("form").validate({
            rules: {
                txtAmount: {
                    required: true,
                    number: true
                },
            },
            messages: {
            },
            errorPlacement: function(error, element) {
                if (element.hasClass('hasDatepicker'))
                    error.insertAfter(element.next());
                else {
                    var info = element.parent().parent().children('.info');
                    if (info.hasClass('info'))
                        error.insertAfter(info);
                    else
                        error.insertAfter(element);
                }
            }
        });</script>
</body>
</html>
